using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter07
{
	/// <summary>
	/// Example13: Gas Consumed by a Compact Car
	/// A compact car has mass of 800 kg, and its efficiency is 
	/// rated at 18%. (that is 18% of the available fuel energy 
	/// is delivered to the wheels.) Find the amount of gasoline 
	/// used to accelerate the car from rest to 27 m/s (60 mi/h).
	/// Use the fact that the energy equivalent of 1 gal of 
	/// gasoline is 1.3 \times 10^8 J.
	/// answer : 0.013 gal
	/// </summary>
	public class Example13
	{
		public Example13()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Mass m = new L.Mass();
			m.kg = 800.0;
			L.Velocity v = new L.Velocity();
			v.X = 27.0;
			L.KineticEnergy KE = new L.KineticEnergy(m,v);
			// 1 gal : 0.18*1.3*10^8 = x : KE.J;
			result+=Convert.ToString(KE.J/0.18/1.3/Math.Pow(10.0,8.0));
		}
	}
}
